POV-Ray : Newsgroups : povray.general : Cubic spline question : Cubic spline question Server Time
6 Aug 2024 17:02:14 EDT (-0400)
  Cubic spline question  
From: Rune
Date: 15 Feb 2002 17:22:36
Message: <3c6d8a2c@news.povray.org>
I'm getting confused by cubic splines.

Doesn't cubic splines work that way that any point on the spline is
dependent on exactly four control points, no more, no less? At least that's
the impression I get from the POV-Ray documentation, and when using cubic
splines in prisms it works exactly that way indeed.

But the cubic spline used in the spline feature in POV-Ray 3.5 works
completely differently. It seems that there any point on the spline is
dependent on all the control points, or at least much more than four as far
as I can see. The code below illustrates it (POV-Ray 3.5 beta 11).

So, can anyone enlighten me?

camera {location 6*y look_at 0 translate 3*x}
light_source {1000*y, color 1}
plane {y, 0 pigment {checker color rgb 1.0, color rgb 0.9}}
#declare Spline =
spline {
   cubic_spline
   0, 0*x+30*z,
   1, 1*x,
   2, 2*x,
   3, 3*x,
   4, 4*x,
   5, 5*x,
   6, 6*x,
}
#declare C = 0;
#while (C<=240)
   #declare V = C/40;
   #declare Color = <0,0,1>;
   #if (V=int(V)) #declare Color = <1,0,0>; #end
   sphere {Spline(V), 0.03+Color.x/50 pigment {color Color}}
   #declare C = C+1;
#end

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated Jan 20)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.